package com.kehutong.payfees.entity;

import java.sql.Timestamp;
import java.util.List;

import org.coraframework.json.annotation.JSONField;
import org.coraframework.orm.Entity;
import org.coraframework.orm.annotation.Column;
import org.coraframework.orm.annotation.Table;

/**
 * 收费模板
 */
@Table(value = "t_charge_template", comment="缴费模板", multi = true)
public class ChargeTemplate extends Entity {

    private static final long serialVersionUID = 4713921966861884146L;

    protected ChargeTemplate(String id) {
        super(id);
    }

    @Column(comment = "模板名称")
    private String name;

    @Column(comment = "收费项数组")
    private List<String> items;

    @Column(comment = "备注")
    private String remark;

    @JSONField(serialize = false)
    @Column(comment = "逻辑删除标记")
    private boolean deleted;

    @Column(comment = "最后修改者")
    private String updateBy;

    @JSONField(serialize = false)
    @Column(comment = "创建者")
    private String createBy;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public List<String> getItems() {
        return items;
    }

    public void setItems(List<String> items) {
        this.items = items;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public boolean isDeleted() {
        return deleted;
    }

    public void setDeleted(boolean deleted) {
        this.deleted = deleted;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public int getItemsCount() {
        return items == null ? 0 : items.size();
    }

    /**
     * json序列化该字段
     */
    public Timestamp getUpdateAt() {
        return super.getUpdateTime();
    }
}
